<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
import { getTestReport } from "@/api/index";
let id = ref(0);
onLoad((option:any) => {
  if (option.id) id.value = option.id;
  getTestReportHandler();
});
let nodeData = ref("");
function getTestReportHandler() {
  getTestReport({ report_id: id.value }).then((res) => {
    const { data } = res;
    nodeData.value=formatRichText(data.content);
  });
}
function formatRichText(node: string) {
  let newContent = node.replace(
    /\<img/gi,
    '<img style="width:100%;height:auto;display:block;"'
  );

  return newContent;
}
</script>

<template>
  <view class="wrap">
    <view :innerHTML="nodeData"></view>
  </view>
</template>

<style scoped lang="scss"></style>
